from time import sleep

from selenium.webdriver.common.by import By

from base.base_page import BasePage


class PageDishDelete(BasePage):
    # 实列化属性
    def __init__(self):
        # 实列化父类属性
        super().__init__()
        # 删除菜品
        self.dish_delete_choice = (By.CSS_SELECTOR, "button.delBut > span")
        # 点击删除按钮
        self.delete_btn =(By.CSS_SELECTOR, "button.el-button.el-button--default.el-button--small.el-button--primary")

    # 删除菜品页面方法
    def page_dish_delete(self):
        sleep(1)
        # 点击删除按钮
        self.base_click(self.dish_delete_choice)
        # 点击确认删除按钮
        sleep(2)
        self.base_click(self.delete_btn)
